package kr.totalcall.business
{
	import mx.collections.ArrayCollection;

	/**
	 * 작업 기록
	 * 2012. 8. 21. / 이규광 / 최초 작성.
	 */
	/**
	 * 내용.
	 * @productversion Flex 4.5
	 * @langversion ActionScript 3.0
	 * @playerversion Flash 10.2
	 * @author 이규광.
	 */
	public class LocationNum
	{
		
		// 지역번호.
		[Bindable]
		public static var locNumAC:ArrayCollection = new ArrayCollection([
			"02"
			,"031" 		//경기
			,"032"		//인천 
			,"033" 		//강원
			,"041" 		//충남
			,"042" 		//대전
			,"043" 		//충북
			,"044" 		//세종
			,"051" 		//부산
			,"052" 		//울산
			,"053"		//대구
			,"054" 		//경북
			,"055" 		//경남
			,"061" 		//전남
			,"062" 		//광주
			,"063" 		//전북
			,"064"		//제주
			
			,"070"		//인터넷
		]);
		
		public static function existLocationNum(phoneNum:String):int{
			var locNum:String = phoneNum.substr(0, 2);
			
			if(locNum == "02"){					// 서울
				return 2;
			}
			
			locNum = phoneNum.substr(0, 3);
			if(locNum == "051" 			//부산
				|| locNum == "053"		//대구
				|| locNum == "032"		//인천 
				|| locNum == "062" 		//광주
				|| locNum == "042" 		//대전
				|| locNum == "052" 		//울산
				|| locNum == "044" 		//세종
				|| locNum == "031" 		//경기
				|| locNum == "033" 		//강원
				|| locNum == "043" 		//충북
				|| locNum == "041" 		//충남
				|| locNum == "063" 		//전북
				|| locNum == "061" 		//전남
				|| locNum == "054" 		//경북
				|| locNum == "055" 		//경남
				|| locNum == "064" ){		//제주
				
				return 3;
			}
			
			return -1;
		}
		
		
		public static function getTypicalNum(phoneNum:String):String{
			var exist:int = existLocationNum(phoneNum);
			if(exist != -1){
				phoneNum.substr(exist);
			}
			
			return phoneNum;
		}
		
		
		
		
		/**
		 * 생성자
		 */
		public function LocationNum()
		{
		}
	}
}